import { Button, Text, TextInput } from "std-widgets.slint";

export component AppWindow {
    Window {
    preferred-width: 300px;
    preferred-height: 200px;
    title: "创建序列文件夹";
    default-font-family: "Noto Sans";
    default-font-size: 16px;
    
    forward-focus: input;
    property <string> folder-name <=> input.text;
    property <int> queue-number;

    callback hello(string);
    callback assemble-folder-name();
    callback mkdir();

    VerticalLayout {
        alignment: start;
        padding: 8px;
        spacing: 8px;
        HorizontalLayout {
            spacing: 8px;

            Rectangle {
                border-width: 1px;
                border-color: #555;
                border-radius: 6px;
                input := TextInput {
                    text: "";
                    vertical-alignment: center;
                    single-line: true;
                    x: 4px;
                    accepted => {
                        mkdir();
                    }
                    edited => {
                        assemble-folder-name();
                    }
                }
            }
            Button {
                text: "创建";
                clicked => {
                    mkdir();
                }
            }
        }
        Text {
            text: queue-number + "_" + folder-name;
            wrap: word-wrap;
            overflow: TextOverflow.clip;
        }
    }
}
} 